package com.jvyou.mybatis.utils.clazz;

/**
 * @author 橘柚
 * @version 1.0-SNAPSHOT
 * @Date 2024/8/3 19:45
 * @Description
 */
public class TypeUtils {

    /**
     * 判断是否是基本类型
     *
     * @param clazz 类型
     * @return 是否是基本类型
     */
    public static boolean isBaseType(Class<?> clazz) {
        return clazz.isPrimitive()
                || clazz.isAssignableFrom(String.class)
                || clazz.isAssignableFrom(Integer.class)
                || clazz.isAssignableFrom(Long.class)
                || clazz.isAssignableFrom(Double.class)
                || clazz.isAssignableFrom(Float.class)
                || clazz.isAssignableFrom(Short.class)
                || clazz.isAssignableFrom(Byte.class)
                || clazz.isAssignableFrom(Character.class)
                || clazz.isAssignableFrom(Boolean.class);
    }

}
